import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexpDemo {
    public static void main(String[] args) {
        Pattern pattern = Pattern.compile("^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$");
        String[] emails = { "shiyanlou@shiyanlou.com", "shiyanlou" };
        for (String email : emails) {
            Matcher matcher = pattern.matcher(email);
            System.out.println(email + "is a valid email address: " + matcher.matches());
        }
    }
}
